<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class crm_order extends Model
{
    //工单表模型
    protected $table = 'crm_order';
    public $timestamps = false;
    
    // 关联客户表模型
    public function crm_customer()
    {
        return $this->belongsTo('App\crm_customer','order_customerid', 'id');
    }
    // 关联线路表模型
    public function crm_route1()
    {
        return $this->belongsTo('App\crm_route','order_didian', 'id');
    }
    // 关联线路表模型
    public function crm_route2()
    {
        return $this->belongsTo('App\crm_route','order_didian2', 'id');
    }
    // 关联员工模型
    public function admin_users()
    {
        return $this->belongsTo('App\Admin_users','staff_id', 'id');
    }
    // 关联标签模型
    public function crm_biaoqian()
    {
        return $this->belongsTo('App\crm_biaoqian','order_lvyouleibie', 'id');
    }
    // 关联客户表模型
    public function customer_name()
    {
        return $this->belongsTo('App\crm_customer','order_customerid','customer_name');
    }
}
